<script type="text/javascript"
	src="views/parkLotCenter/chargeStandard/js/tempCharge.js"></script>

<script type="text/javascript">
    var tempchargeList = null;
    $(document).ready(function() {
        tempchargeList = new tempChargeList($("#tempChargeListDiv"));
    });
</script>
<div class="main" id="tempChargeListDiv"
	style="height: 100%;width:100%;">
	<div class="search-panel">
		<div class="search-text">
			<label>收费规则名称：</label> <input class="k-textbox"
				data-bind="value:chargeName" validationMessage="规则名不能包含特殊字符"
				pattern="^[\u4e00-\u9fa5A-Za-z0-9-_]*$" />
		</div>
		<div class="search-Btn">
			<button data-bind="click:queryInfo">查询</button> <button data-bind="click:resetInfo">重置</button>
		</div>
	</div>
	<div class="dataList" style=" height: calc(100% - 73px);width:100%;">
	    <div style="overflow-y:auto;overflow-x:hidden;height:calc(100% - 30px)">
			<div id="listView"
				style="height: calc(100% - 30px);width: calc(100% - 60px);border:none"
				class="billingRule-panel"></div>
		</div>
		<div id="pager" class="k-pager-wrap" style="height:30px;width:100%;"></div>
	</div>
	<script type="text/x-kendo-template" id="template">
        <div class="rule-box">
            #if(chargeParamCode == 'unitTime'){#
            <div class="list">
                <div class="title">
                    <span>按单位时段收费</span>
                    <span style="float:right;"><input type="checkbox" name="checkbox" value="#:chargeCode#" /></span>
                </div>
                <div class="content">
                    <div class="text">
                        <span>规则名称：</span>
                        <span>#:chargeName#</span>
                    </div>
                    <div class="text">
                        <span>收费规则编号：</span>
                        <span style="color:blue;font-weight:bold">#:chargeCode#</span>
                    </div>
                    <div class="text">
                        <span>计费分割方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.CUMULATIVE_WAY.ROOT,chargeStandardInfos.A.cumulativeWay)#</span>
                    </div>
					<div class="text">
                        <span>计费累计方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.CUMULATIVE_TYPE.ROOT,chargeStandardInfos.A.cumulativeType)#</span>
                    </div>
                    <div class="text">
                        <span>免费超时计费：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.BOTT_LEVEL_ROOT.ROOT,chargeStandardInfos.A.freeOvertimeBiling)#</span>
                    </div>
                    <div class="text">
                        <span>优免方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.FREE_PREFERENTIAL_WAY.ROOT,chargeStandardInfos.A.freePreferentialWay)#</span>
                    </div>
                    <div class="text">
                        <span>免费停车时长：</span>
                        <span>#:chargeStandardInfos.A.freeTime==undefined ? '无':chargeStandardInfos.A.freeTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>收费时段：</span>
                        <span>#:chargeStandardInfos.A.billableHoursGroup == '0' ? '全天' : '分时'#</span>
                    </div>
                    <div class="text">
                        <span>首段收费时长：</span>
                        <span>#:chargeStandardInfos.A.firstTime==undefined ? '无':chargeStandardInfos.A.firstTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>首段收费金额：</span>
                        <span>#:chargeStandardInfos.A.firstChargeMoney==undefined ? '无':chargeStandardInfos.A.firstChargeMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>间隔收费时长：</span>
                        <span>#:chargeStandardInfos.A.intervalChargingTime==undefined ? '无':chargeStandardInfos.A.intervalChargingTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>间隔收费金额：</span>
                        <span>#:chargeStandardInfos.A.intervalChargingMoney==undefined ? '无':chargeStandardInfos.A.intervalChargingMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>满时时长：</span>
                        <span>#:chargeStandardInfos.A.thresholdTime ==undefined ? '无':chargeStandardInfos.A.thresholdTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>满时封顶金额：</span>
                        <span>#:chargeStandardInfos.A.thresholdMoney == '-1' ? '无':chargeStandardInfos.A.thresholdMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>每日封顶时间：</span>
                        <span>#:chargeStandardInfos.A.dailyCapTime == '-1' ? '无':chargeStandardInfos.A.dailyCapTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>每日封顶金额：</span>
                        <span>#:chargeStandardInfos.A.dailyCapMoney == '-1' ? '无':chargeStandardInfos.A.dailyCapMoney+' 元'#</span>
                    </div>
                </div>
                #if(chargeStandardInfos.B != undefined ){#
                <div class="tableDiv">
                    <table width="100%">
                        <tr>
                            <th>开始时间</th>
                            <th>结束时间</th>
                            <th>间隔收费时长(分钟)</th>
                            <th>间隔收费金额(元)</th>
                        </tr>
                        # var arrayinfo = chargeStandardInfos.B;
                        var l = Object.getOwnPropertyNames(arrayinfo).length;
                        if (arrayinfo && l < 1) {
                        return;
                        }

                        for(var i=0;i < l;i++){
                        var key = "array"+i;
                        if(arrayinfo.hasOwnProperty(key)){
                        var item = eval('(' + arrayinfo[key] + ')');#
                        <tr>
                            <td>#:item.beginTime#</td>
                            <td>#:item.endTime#</td>
                            <td>#:item.intervalChargingTime#</td>
                            <td>#:item.intervalChargingMoney#</td>
                        </tr>
                        #}
                        }#
                    </table>
                </div>
                #}#
            </div>
            #}else if(chargeParamCode == 'totalLength'){#
            <div class="list">
                <div class="title">
                    <span>按总计时长收费</span>
                    <span style="float:right;"><input type="checkbox" name="checkbox" value="#:chargeCode#" /></span>
                </div>
                <div class="content">
                    <div class="text">
                        <span>规则名称：</span>
                        <span>#:chargeName#</span>
                    </div>
                    <div class="text">
                        <span>收费规则编号：</span>
                        <span style="color:blue;font-weight:bold">#:chargeCode#</span>
                    </div>
                    <div class="text">
                        <span>累计收费方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.CUMULATIVE_WAY.ROOT,chargeStandardInfos.A.cumulativeWay)#</span>
                    </div>
                    <div class="text">
                        <span>免费超时计费：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.BOTT_LEVEL_ROOT.ROOT,chargeStandardInfos.A.freeOvertimeBiling)#</span>
                    </div>
                    <div class="text">
                        <span>优免方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.FREE_PREFERENTIAL_WAY.ROOT,chargeStandardInfos.A.freePreferentialWay)#</span>
                    </div>
                </div>
                #if(chargeStandardInfos.B != undefined ){#
                <div class="tableDiv">
                    <table width="100%">
                        <tr>
                            <th>开始时间</th>
                            <th>结束时间</th>
                            <th>收费金额(元)</th>
                        </tr>
                        # var arrayinfo = chargeStandardInfos.B;
                        var l = Object.getOwnPropertyNames(arrayinfo).length;
                        if (arrayinfo && l < 1) {
                        return;
                        }

                        for(var i=0;i < l;i++){
                        var key = "array"+i;
                        if(arrayinfo.hasOwnProperty(key)){
                        var item = eval('(' + arrayinfo[key] + ')');#
                        <tr>
                            <td>#:item.beginTime#</td>
                            <td>#:item.endTime#</td>
                            <td>#:item.payMoney#</td>
                        </tr>
                        #}
                        }#
                    </table>
                </div>
                #}#
            </div>
            #}else if(chargeParamCode == 'chargeNumber'){#
            <div class="list">
                <div class="title">
                    <span>按次收费</span>
                    <span style="float:right;"><input type="checkbox" name="checkbox" value="#:chargeCode#" /></span>
                </div>
                <div class="content">
                    <div class="text">
                        <span>规则名称：</span>
                        <span>#:chargeName#</span>
                    </div>
                    <div class="text">
                        <span>收费规则编号：</span>
                        <span style="color:blue;font-weight:bold">#:chargeCode#</span>
                    </div>
                    <div class="text">
                        <span>累计收费方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.CUMULATIVE_WAY.ROOT,chargeStandardInfos.A==undefined?'':chargeStandardInfos.A.cumulativeWay)#</span>
                    </div>
                    <div class="text">
                        <span>免费超时计费：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.BOTT_LEVEL_ROOT.ROOT,chargeStandardInfos.A==undefined?'':chargeStandardInfos.A.freeOvertimeBiling)#</span>
                    </div>
                    <div class="text">
                        <span>优免方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.FREE_PREFERENTIAL_WAY.ROOT,chargeStandardInfos.A==undefined?'':chargeStandardInfos.A.freePreferentialWay)#</span>
                    </div>
					<div class="text">
                        <span>免费停车时长：</span>
                        <span>#:chargeStandardInfos.A.freeTime==undefined ? '无':chargeStandardInfos.A.freeTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>单次收费金额：</span>
                        <span>#:chargeStandardInfos.A.payMoney==undefined ? '无':chargeStandardInfos.A.payMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>每日封顶金额：</span>
                        <span>#:chargeStandardInfos.A.dailyCapMoney == '-1' ? '无':chargeStandardInfos.A.dailyCapMoney+' 元'#</span>
                    </div>
                </div>
            </div>
            #}else if(chargeParamCode == 'dayNight'){#
            <div class="list">
                <div class="title">
                    <span>日夜组合收费</span>
                    <span style="float:right;"><input type="checkbox" name="checkbox" value="#:chargeCode#" /></span>
                </div>
                <div class="content">
                    <div class="text">
                        <span>规则名称：</span>
                        <span>#:chargeName#</span>
                    </div>
                    <div class="text">
                        <span>收费规则编号：</span>
                        <span  style="color:blue;font-weight:bold">#:chargeCode#</span>
                    </div>
                    <div class="text">
                        <span>累计收费方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.CUMULATIVE_WAY.ROOT,chargeStandardInfos.A!=undefined?chargeStandardInfos.A.cumulativeWay:null)#</span>
                    </div>
                    <div class="text">
                        <span>免费超时计费：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.BOTT_LEVEL_ROOT.ROOT,chargeStandardInfos.A!=undefined?chargeStandardInfos.A.freeOvertimeBiling:null)#</span>
                    </div>
                    <div class="text">
                        <span>优免方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.FREE_PREFERENTIAL_WAY.ROOT,chargeStandardInfos.A!=undefined?chargeStandardInfos.A.freePreferentialWay:null)#</span>
                    </div>
                </div>
            </div>
            <div class="list">
                <div class="title2">白天</div>
                <div class="content">
                    <div class="text" style="width:100%">
                        <span>开始时间：</span>
                        <span>#:chargeStandardInfos.day.beginTime#</span>
                    </div>
                    <div class="text">
                        <span>首段收费时长：</span>
                        <span>#:chargeStandardInfos.day.firstTime ==undefined ? '无':chargeStandardInfos.day.firstTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>首段收费金额：</span>
                        <span>#:chargeStandardInfos.day.firstChargeMoney==undefined ? '无':chargeStandardInfos.day.firstChargeMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>间隔收费时长：</span>
                        <span>#:chargeStandardInfos.day.intervalChargingTime==undefined ? '无':chargeStandardInfos.day.intervalChargingTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>间隔收费金额：</span>
                        <span>#:chargeStandardInfos.day.intervalChargingMoney==undefined ? '无':chargeStandardInfos.day.intervalChargingMoney+' 元'#</span>
                    </div>
                </div>
            </div>
            <div class="list">
                <div class="title2">夜晚</div>
                <div class="content">
                    <div class="text" style="width:100%">
                        <span>开始时间：</span>
                        <span>#:chargeStandardInfos.night.beginTime#</span>
                    </div>
                    <div class="text">
                        <span>收费方式：</span>
                        <span>#:chargeStandardInfos.night.payMethod =='0' ? '按次收费' : '分时收费' #</span>
                    </div>
                    #if(chargeStandardInfos.night.payMethod == '0'){#
                    <div class="text">
                        <span>单次收费金额：</span>
                        <span>#:chargeStandardInfos.night.payMoney==undefined ? '无':chargeStandardInfos.night.payMoney+' 元'#</span>
                    </div>
                    #}else if(chargeStandardInfos.night.payMethod == '1'){#
                    <div class="text">
                        <span>首段收费时长：</span>
                        <span>#:chargeStandardInfos.night.firstTime==undefined ? '无':chargeStandardInfos.night.firstTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>首段收费金额：</span>
                        <span>#:chargeStandardInfos.night.firstChargeMoney==undefined ? '无':chargeStandardInfos.night.firstChargeMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>间隔收费时长：</span>
                        <span>#:chargeStandardInfos.night.intervalChargingTime==undefined ? '无':chargeStandardInfos.night.intervalChargingTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>间隔收费金额：</span>
                        <span>#:chargeStandardInfos.night.intervalChargingMoney==undefined ? '无':chargeStandardInfos.night.intervalChargingMoney+' 元'#</span>
                        <span>元</span>
                    </div>
                    #}#
                </div>
            </div>
            <div class="list">
                <div class="title2">24小时</div>
                <div class="content">
                    <div class="text">
                        <span>免费停车时长：</span>
                        <span>#:chargeStandardInfos.allDay.freeTime==undefined ? '无':chargeStandardInfos.allDay.freeTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>单次收费金额：</span>
                        <span>#:chargeStandardInfos.allDay.payMoney==undefined ? '无':chargeStandardInfos.allDay.payMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>每日封顶金额：</span>
                        <span>#:chargeStandardInfos.allDay.dailyCapMoney == '-1' ? '无' : chargeStandardInfos.allDay.dailyCapMoney+' 元'#</span>
                    </div>
                    <div class="text">
                        <span>每日封顶时间：</span>
                        <span>#:chargeStandardInfos.allDay.dailyCapTime == '-1' ? '无' : chargeStandardInfos.allDay.dailyCapTime+' 分钟'#</span>
                    </div>
                </div>
            </div>
            #}else if(chargeParamCode == 'chargeTime'){#
            <div class="list">
                <div class="title">
                    <span>按停车时长收费</span>
                    <span style="float:right;"><input type="checkbox" name="checkbox" value="#:chargeCode#" /></span>
                </div>
                <div class="content">
                    <div class="text">
                        <span>规则名称：</span>
                        <span>#:chargeName#</span>
                    </div>
                    <div class="text">
                        <span>收费规则编号：</span>
                        <span style="color:blue;font-weight:bold">#:chargeCode#</span>
                    </div>
                    <div class="text">
                        <span>累计收费方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.CUMULATIVE_WAY.ROOT,chargeStandardInfos.A.cumulativeWay)#</span>
                    </div>
                    <div class="text">
                        <span>免费超时计费：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.BOTT_LEVEL_ROOT.ROOT,chargeStandardInfos.A.freeOvertimeBiling)#</span>
                    </div>
                    <div class="text">
                        <span>优免方式：</span>
                        <span>#:Utils.getModelNameByParentKey(BASIS.FREE_PREFERENTIAL_WAY.ROOT,chargeStandardInfos.A.freePreferentialWay)#</span>
                    </div>
                    <div class="text">
                        <span>免费停车时长：</span>
                        <span>#:chargeStandardInfos.A.freeTime==undefined ? '无':chargeStandardInfos.A.freeTime+' 分钟'#</span>
                    </div>
                    <div class="text">
                        <span>每日封顶金额：</span>
                        <span>#:chargeStandardInfos.A.dailyCapMoney == '-1' ? '无' : chargeStandardInfos.A.dailyCapMoney+' 元'#</span>
                    </div>
                </div>
                #if(chargeStandardInfos.B != undefined ){#
                <div class="tableDiv">
                    <table width="100%">
                        <tr>
                            <th>起始时间(分钟)</th>
                            <th>结束时间(分钟)</th>
                            <th>收费金额(元)</th>
                        </tr>
                        # var arrayinfo = chargeStandardInfos.B;
                        var l = Object.getOwnPropertyNames(arrayinfo).length;
                        if (arrayinfo && l < 1) {
                        return;
                        }

                        for(var i=0;i < l;i++){
                        var key = "array"+i;
                        if(arrayinfo.hasOwnProperty(key)){
                        var item = eval('(' + arrayinfo[key] + ')');#
                        <tr>
                            <td>#:item.beginTime#</td>
                            <td>#:item.endTime#</td>
                            <td>#:item.payMoney#</td>
                        </tr>
                        #}
                        }#
                    </table>
                </div>
                #}#
            </div>
            #}#
        </div>
    </script>
</div>
